﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true" CodeBehind="NewsEdit.aspx.cs" Inherits="Thuoc24h.AdminCP.Pages.NewsEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
    <script>
        $(function () {
            $('#<%= txtName.ClientID %>').change(function () {
                var alias = ConvertToUnSign(this.value);
                $('#<%= txtUnsignName.ClientID %>').val(alias);
            });
        });

    </script>
    <script type="text/javascript">
        function OpenFileExplorerDialog() {
            var wnd = $find("<%= ExplorerWindow.ClientID %>");

            wnd.show();
        }


        //This function is called from a code declared on the Explorer.aspx page
        function OnFileSelected(fileSelected) {

            var textbox = $find("<%= txtFileName.ClientID %>");
            textbox.set_value(fileSelected);
        }
        function OnUrlSelected(urlSelected) {
            var textbox = $find("<%= txtFileName.ClientID %>");
        textbox.set_value(urlSelected);
    }






    </script>
    <Telerik:RadWindow runat="server" Width="800px" Height="450px" VisibleStatusbar="false"
        ShowContentDuringLoad="false" NavigateUrl="/AdminCP/Pages/Explorer.aspx" ID="ExplorerWindow"
        Modal="true" Behaviors="Close,Move">
    </Telerik:RadWindow>
    <asp:HiddenField ID="hfCategoryId" runat="server" />
    <Telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="100%" Height="100%"
        ExpandMode="FullExpandedItem">
        <Items>
            <Telerik:RadPanelItem Text="Thêm / sửa bài viết" Expanded="True">
                <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                                <div class="fleft" style="font-weight: bold; width: 120px; text-align: right; color: #00156E; font-size: 12px;">Chuyên mục:
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" Display="Dynamic" ForeColor="red" ControlToValidate="radTreeCategories" runat="server" ErrorMessage="*" />

                                </div>
                            </td>
                            <td valign="top">
                                <Telerik:RadTreeView ID="radTreeCategories" OnNodeClick="radTreeCategories_NodeClick" CausesValidation="False"
                                    runat="server" Width="300px" Height="200px">
                                    <DataBindings>
                                        <Telerik:RadTreeNodeBinding Expanded="True" />
                                    </DataBindings>
                                </Telerik:RadTreeView>

                            </td>
                            <td>
                                <div class="fleft" style="font-weight: bold; width: 80px; text-align: right; color: #00156E; font-size: 12px;">Tin liên quan:</div>
                                <Telerik:RadListBox ID="radListbox" runat="server" DataTextField="Title" DataValueField="Id" CheckBoxes="True" Width="390px" Height="200px" AutoPostBack="False">
                                </Telerik:RadListBox>
                            </td>

                        </tr>
                    </table>

                    <div class="item">
                        <label>Tên:</label><Telerik:RadTextBox runat="server" ID="txtName" Width="70%" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" ForeColor="red" ControlToValidate="txtName" runat="server" ErrorMessage="*" />
                    </div>
                    <div class="item">
                        <label>Tên không dấu:</label><Telerik:RadTextBox runat="server" ID="txtUnsignName" Width="70%" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" ForeColor="red" ControlToValidate="txtUnsignName" runat="server" ErrorMessage="*" />
                    </div>

                    <div class="item">
                        <label>Ảnh:</label><Telerik:RadTextBox runat="server" ID="txtFileName" Width="350px" /><span style="display: inline-block; cursor: pointer" id="btnUpload" onclick="OpenFileExplorerDialog(); return false;"><strong>Chọn ảnh...</strong></span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Display="Dynamic" ForeColor="red" ControlToValidate="txtUnsignName" runat="server" ErrorMessage="*" />
                    </div>
                    <div class="item">
                        <label>Mô tả:</label><Telerik:RadTextBox runat="server" ID="edtDescription" TextMode="MultiLine" Width="70%" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="Dynamic" ForeColor="red" ControlToValidate="edtDescription" runat="server" ErrorMessage="*" />
                    </div>

                    <div class="item">
                        <table>

                            <tr>
                                <td>
                                    <div class="fleft" style="font-weight: bold; width: 120px; text-align: right; color: #00156E; font-size: 12px;">Chi tiết:</div>
                                </td>
                                <td>
                                    <Telerik:RadEditor runat="server" ID="edtDetail" Width="80%" >
                                <ImageManager UploadPaths="~/Upload" DeletePaths="~/Upload" ViewPaths="~/Upload" ImageEditorFileSuffix="~/Upload/"></ImageManager>
                                        
                                    </Telerik:RadEditor>
                                </td>
                            </tr>
                        </table>



                    </div>


                    <div class="item">
                        <label>Chức năng:</label>
                        <asp:CheckBox runat="server" Text="H.thị trên danh sách" CssClass="option" ID="cbIsDisplayOnList" AutoPostBack="False" />
                        <asp:CheckBox runat="server" Text="H.thị trên Slide" CssClass="option" ID="cbIsDisplayInOnFooter" AutoPostBack="False"/>
                        <asp:CheckBox runat="server" Text="H.thị trên Header" CssClass="option" ID="cbIsDisplayInOnHeader" AutoPostBack="False" />
                        <asp:CheckBox runat="server" Text="H.thị trên Footer" CssClass="option" ID="cbIsDisplayInOnSlide" AutoPostBack="False"/>
                    </div>


                    <div class="item">
                        <label>Ngày tạo:</label><Telerik:RadDateTimePicker runat="server" ID="radCreateDate" Width="218px" />
                    </div>




                    <div class="item" style="padding-bottom: 30px">
                        <label></label>
                        <Telerik:RadButton runat="server" ID="btnSave" OnClick="btnSave_OnClick"></Telerik:RadButton>
                        <Telerik:RadButton ID="btnReset" runat="server" Text="Làm lại" OnClick="OnClick" CausesValidation="False"></Telerik:RadButton>
                    </div>
                </ContentTemplate>
            </Telerik:RadPanelItem>

        </Items>
    </Telerik:RadPanelBar>

</asp:Content>

